import java.io.File;
import java.util.*;

public class F0r3n51c700L5{
public static void AvSpace(String path){
   
      String files;
      File folder = new File(path);
      long FrSpAv = folder.getFreeSpace();
   
      FrSpAv = FrSpAv/1073741824;
   
   
      System.out.println("You have " + FrSpAv + " GB available" );
     
   }

public static void ListFiles(String path){
   
   //String path = "/Users/love/Downloads"; // - Test.
   
      String files;
      File folder = new File(path);
      File[] listOfFiles = folder.listFiles(); 
   
      for (int i = 0; i < listOfFiles.length; i++) 
      {
      
         if (listOfFiles[i].isFile()) 
         {
            files = listOfFiles[i].getName();
            System.out.println(files);
         }
      }
   }
public static void OSinfo(){
      String nameOS = "os.name";  
      String versionOS = "os.version";  
      String architectureOS = "os.arch";
      
      System.out.println("\n  The information about OS");
      System.out.println("\nName of the OS: " + 
        System.getProperty(nameOS));
        
      System.out.println("Version of the OS: " + 
         System.getProperty(versionOS));
         
      System.out.println("Architecture of The OS: " + 
         System.getProperty(architectureOS));
   }

public static String GetSecurePass(){
   
      
      String a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ<>?/;:/-'|+.#&$%^!abcdefghijklmnopqrstuvwxyz0123456789";
      String pass="";  
      int k=2;
      int i=0;
      int l=a.length();
      
      while(k==2){
         while(i < 100){
                     int rand=(int) (Math.random()*l);
                     pass=(pass+(a.charAt(rand)));
                     ++i;
                  }
               
                  if(pass.matches(".*[A-Z].*")&&pass.matches(".*[a-z].*")&&pass.matches(".*[0-9].*")&&pass.matches(".*[\\W_].*")){
                  
                     System.out.println("Secure pass generated: "+pass);
                     int length = pass.length();
                     System.out.println ("Length of password: "+length);
                     k=1;
                  }
                        
                  else  {
                     i=0;
                     pass="";
                        }
                  }
          return pass;
   }

 public static void ListFiletype(String path, String type) {
 
  String files;
  File folder = new File(path);
  File[] listOfFiles = folder.listFiles(); 
 
  for (int i = 0; i < listOfFiles.length; i++) 
  {
 
   if (listOfFiles[i].isFile()) 
   {
   files = listOfFiles[i].getName();
       if (files.endsWith("."+type.toLowerCase()) || files.endsWith("."+type.toUpperCase()))
       {
          System.out.println(files);
        }
     }
  }
}

}
